﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <link href="~/static/h-ui/css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="~/static/h-ui.admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" type="text/css" />
    <link href="~/static/h-ui.admin/skin/default/skin.css" rel="stylesheet" id="skin" type="text/css" />
    <link href="~/static/h-ui.admin/css/style.css" rel="stylesheet" type="text/css" />
    <script src="~/lib/jquery/1.9.1/jquery.min.js"></script>
    <title>QueryTestPaper查看试卷</title>
</head>
<body>
    <div>
        <div class="page-container">
            <article class="page-container">
                <form class="form form-horizontal" id="form-article-add">
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">学院：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <span class="select-box">
                                <select name="articlecolumn" id="College" class="select" onchange="CollegeChange()">
                                    <option value="0">请选择</option>
                                    @foreach (var item in ViewBag.College)
                                    {
                                        <option value="@item.ID">@item.College_Name</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">方向：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <span class="select-box">
                                <select name="articletype" id="Major" class="select">
                                    <option value="0">请选择</option>
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2">阶段：</label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <span class="select-box">

                                <select name="articletype" id="Course" class="select">
                                    @foreach (var item in ViewBag.Course)
                                    {
                                        <option value="@item.ID">@item.Course_Name</option>
                                    }
                                </select>
                            </span>
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-4 col-sm-2"></label>
                        <div class="formControls col-xs-8 col-sm-9">
                            <input type="submit" value="查找试卷" />
                        </div>
                    </div>
                </form>
            </article>
            <div class="col-md-8 col-md-offset-2">
                <table class="table table-border table-bordered table-hover table-bg mt-20">
                    <thead>
                        <tr>
                            <th colspan="6" scope="col">试卷信息</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>试题编号</td>
                            <td>试题名称</td>
                            <td>考试开始时间</td>
                            <td>考试结束时间</td>
                            <td>是否开放</td>
                            <td>操作</td>
                        </tr>
                        <tr>
                            <td>1 </td>
                            <td>PMP项目管理</td>
                            <td>2017-7-24 9:00 </td>
                            <td>2017-7-24 9:45 </td>
                            <td>
                                <input type="button" value="开启考试" />
                                <input type="button" value="关闭考试" />
                            </td>
                            <td>
                                <input type="button" value="查看详情" />
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>
</html>
<script>
    //根据学院编号获取对应的专业
    function CollegeChange() {
        var collegeID = $("#College").val();
        $.ajax({
            type: "post",
            url: "/Admin/MajorList",
            data: { ID: collegeID },
            success: function (data) {
                if (data.length > 0) {
                    data = eval(data);
                    $("#Major").empty();
                    var html = "";
                    for (var i = 0; i < data.length; i++) {
                        html += "  <option value='" + data[i].ID + "'>" + data[i].Major_Name + "</option>";
                    }
                    $("#Major").append(html);
                }
            }
        });
    }
</script>